
const router = require('koa-router')();
const multer = require('koa-multer');

const upload = multer({ dest: 'uploads' })

router.post('/api/admin/uploads', upload.single('file'), async (ctx, next) => {
    ctx.req.file.url = "http://localhost:3000/" + ctx.req.file.path
    ctx.body = ctx.req.file
})

module.exports = router